<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
      // var obj1 = {m: 1}  // count = 1
      // var obj2 = obj1 // count = 2
      // obj1 = null // count=1
      // obj2 = null // count = 0

      // 引用计数法的循环引用问题
      var obj1 = {m: 1}   // count1 = 1
      var obj2 = {m: 2} // count2 = 1
      obj1.n = obj2  // count2 = 2
      obj2.n = obj1 // count1 = 2

      obj1 = null  // count1 = 1
      obj2 = null // count2 = 1

      // 当断开指向带循环引入的2个对象的外部引入后, 这2个对象无法再访问到了, 应该是, 
      // 但由于有想到引用, 引用计数就是1, 不是垃圾对象  => 有问题



  </script>
</body>
</html>